<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="zxx">
<%
    request.getAttribute("type");
    request.getAttribute("noticeList");
%>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Dominie</title>

    <!-- Stylesheet -->
    <link rel="stylesheet" href="assets/css/vendor.css">
    <link rel="stylesheet" href="assets/css/style.css">
    <link rel="stylesheet" href="assets/css/responsive.css">
    <link rel="stylesheet" href="assets/css/page.css">

</head>

<body>

<!-- preloader area start -->
<div class="preloader" id="preloader">
    <div class="preloader-inner">
        <div class="spinner">
            <div class="dot1"></div>
            <div class="dot2"></div>
        </div>
    </div>
</div>
<!-- preloader area end -->

<!-- 搜索框search popup start-->
<div class="body-overlay" id="body-overlay"></div>
<div class="td-search-popup" id="td-search-popup">
    <form action="index.html" class="search-form">
        <div class="form-group">
            <input type="text" class="form-control" placeholder="Search.....">
        </div>
        <button type="submit" class="submit-btn"><i class="fa fa-search"></i></button>
    </form>
</div>
<!-- 搜索框search popup end-->

<!-- log-in popup start-->
<%--<div class="td-log-in-popup" id="td-log-in-popup">--%>
<%--    <div class="navbar-area navbar-area-1">--%>
<%--        <nav class="navbar navbar-expand-lg">--%>
<%--            <div class="container nav-container">--%>
<%--                <div class="responsive-mobile-menu">--%>
<%--                    <button class="menu toggle-btn d-block d-lg-none" data-target="#themefie_main_menu"--%>
<%--                            aria-expanded="false" aria-label="Toggle navigation">--%>
<%--                        <span class="icon-left"></span>--%>
<%--                        <span class="icon-right"></span>--%>
<%--                    </button>--%>
<%--                </div>--%>
<%--                <div class="logo">--%>
<%--                    <a class="main-logo" href="index.html"><img src="assets/img/logo.png" alt="img"></a>--%>
<%--                </div>--%>
<%--                <div class="nav-right-part nav-right-part-mobile">--%>
<%--                    <a class="search" href="#"><i class="fa fa-search"></i></a>--%>
<%--                    <a class="btn btn-base log-in" href="#">Login</a>--%>
<%--                </div>--%>
<%--                <div class="collapse navbar-collapse" id="themefie_main_menu">--%>
<%--                    <ul class="navbar-nav menu-open text-left pl-lg-5">--%>
<%--                        <li><a href="contact.html">新闻速览</a></li>--%>
<%--                        <li><a href="contact.html">会议公告</a></li>--%>
<%--                        <li><a href="contact.html">综合信息</a></li>--%>

<%--                    </ul>--%>
<%--                </div>--%>
<%--                <div class="nav-right-part nav-right-part-desktop">--%>
<%--                    <a class="btn btn-white log-in" href="#">登录</a>--%>
<%--                </div>--%>
<%--            </div>--%>
<%--        </nav>--%>
<%--    </div class="container">--%>
<%--    <div class="row justify-content-center no-gutters">--%>
<%--        <div class="col-lg-5">--%>
<%--            <div class="log-in-wrap">--%>
<%--                <div class="thumb">--%>
<%--                    <img src="assets/img/logo2.png" alt="img">--%>
<%--                </div>--%>
<%--            </div>--%>
<%--        </div>--%>
<%--        <div class="col-xl-6 col-lg-7">--%>
<%--            <div class="log-in-form" id="login_form" action="${pageContext.servletContext.contextPath}/LoginServlet"--%>
<%--                 method="post">--%>
<%--                <!--  <button type="button" class="close">--%>
<%--                         <span>&times;</span>--%>
<%--                     </button> -->--%>
<%--                <ul class="nav nav-pills">--%>
<%--                    <li class="nav-item">--%>
<%--                        <a class="nav-link active" data-toggle="pill" href="#pills-home">登录</a>--%>
<%--                    </li>--%>
<%--                    <li class="nav-item">--%>
<%--                        <a class="nav-link" data-toggle="pill" href="#pills-profile">注册</a>--%>
<%--                    </li>--%>
<%--                </ul>--%>
<%--                <div class="tab-content">--%>
<%--                    <div class="tab-pane fade show active" id="pills-home">--%>
<%--                        <form action="${pageContext.servletContext.contextPath}/LoginServlet" method="post">--%>
<%--                            <div class="form-group">--%>
<%--                                <label>账号</label>--%>
<%--                                <input type="text" id="user_name" name="username" class="form-control"--%>
<%--                                       placeholder="请输入您的账号">--%>
<%--                            </div>--%>
<%--                            <div class="form-group">--%>
<%--                                <label>密码</label>--%>
<%--                                <input type="password" id="user_pwd" name="password" class="form-control">--%>
<%--                            </div>--%>
<%--                            <div class="form-check">--%>
<%--                                <input type="checkbox" class="form-check-input">--%>
<%--                                <label class="form-check-label">记住登录</label>--%>
<%--                            </div>--%>
<%--                            <a class="lost-password" href="#">忘记密码?</a>--%>
<%--                            <button type="submit" class="btn btn-base w-100">登录</button>--%>
<%--                            <div class="other-log-in-area text-center">--%>
<%--                                <h6>OR LOGIN WITH</h6>--%>
<%--                                <a class="btn btn-fb" href="#"><i class="fa fa-facebook"></i>FACEBOOK</a>--%>
<%--                                <a class="btn btn-google" href="#"><i class="fa fa-google"></i>GOOGLE</a>--%>
<%--                            </div>--%>
<%--                        </form>--%>
<%--                    </div>--%>
<%--                    <div class="tab-pane fade" id="pills-profile">--%>
<%--                        <form>--%>
<%--                            <div class="row">--%>
<%--                                <div class="col-md-6">--%>
<%--                                    <div class="form-group">--%>
<%--                                        <label>Full Name</label>--%>
<%--                                        <input type="text" class="form-control" placeholder="Full Name">--%>
<%--                                    </div>--%>
<%--                                </div>--%>
<%--                                <div class="col-md-6">--%>
<%--                                    <div class="form-group">--%>
<%--                                        <label>User or email*</label>--%>
<%--                                        <input type="text" class="form-control" placeholder="Email">--%>
<%--                                    </div>--%>
<%--                                </div>--%>
<%--                            </div>--%>
<%--                            <div class="form-group">--%>
<%--                                <label>Password</label>--%>
<%--                                <input type="password" class="form-control" placeholder="password">--%>
<%--                            </div>--%>
<%--                            <div class="form-check">--%>
<%--                                <input type="checkbox" class="form-check-input">--%>
<%--                                <label class="form-check-label">Remember me</label>--%>
<%--                            </div>--%>
<%--                            <a class="lost-password" href="#">Lost your password?</a>--%>
<%--                            <button type="submit" class="btn btn-base w-100">登录</button>--%>
<%--                            <div class="other-log-in-area text-center">--%>
<%--                                <h6>OR LOGIN WITH</h6>--%>
<%--                                <a class="btn btn-fb" href="#"><i class="fa fa-facebook"></i>FACEBOOK</a>--%>
<%--                                <a class="btn btn-google" href="#"><i class="fa fa-google"></i>GOOGLE</a>--%>
<%--                            </div>--%>
<%--                        </form>--%>
<%--                    </div>--%>
<%--                </div>--%>
<%--            </div>--%>
<%--        </div>--%>
<%--    </div>--%>
<%--</div>--%>
</div>
<!-- log-in popup end-->

<!-- navbar start -->
<div class="navbar-area navbar-area-1">
    <nav class="navbar navbar-expand-lg">
        <div class="container nav-container">
            <div class="responsive-mobile-menu">
                <button class="menu toggle-btn d-block d-lg-none" data-target="#themefie_main_menu"
                        aria-expanded="false" aria-label="Toggle navigation">
                    <span class="icon-left"></span>
                    <span class="icon-right"></span>
                </button>
            </div>
            <div class="logo">
                <a class="main-logo" href="/HomePageServlet"><img src="assets/img/logo.png" alt="img"></a>
            </div>
<%--            <div class="nav-right-part nav-right-part-mobile">--%>
<%--                <a class="btn btn-base" href="./admin_login.jsp">登录</a>--%>
<%--            </div>--%>
            <div class="collapse navbar-collapse" id="themefie_main_menu">
                <ul class="navbar-nav menu-open text-left pl-lg-5">
                    <li><a href="/NoticeListServlet?type=1">新闻速览</a></li>
                    <li><a href="/NoticeListServlet?type=2">会议公告</a></li>
                    <li><a href="/NoticeListServlet?type=3">综合信息</a></li>
                </ul>
            </div>
<%--            <div class="nav-right-part nav-right-part-desktop">--%>
<%--                <a class="btn btn-white" href="./admin_login.jsp">登录</a>--%>
<%--            </div>--%>
        </div>
    </nav>
</div>
<!-- navbar end -->

<!-- blog start -->
<div class="blog-area pd-top-195">
    <div class="container">
        <div class="section-title text-center">
            <c:if test="${type == 1}"><h2>-新闻速览-</h2></c:if>
            <c:if test="${type == 2}"><h2>-会议公告-</h2></c:if>
            <c:if test="${type == 3}"><h2>-综合信息-</h2></c:if>

        </div>
        <c:forEach items="${noticeList.dataList}" var="list">
            <a href="/NoticeDetailServlet?id=${list.id}?cate=${list.cate}"><div class="single-cart-inner">
                <div class="col-xl-6 col-md-5">
                    <div class="media">
                        <div class="media-left">
                            <img src="${list.cover}" alt="img" style="width:200px;height: 100px;">
                        </div>
                        <div class="media-body align-self-center">
                            <h6>${list.title}</h6>
                            <p>${list.create_time}</p>
                        </div>
                    </div>
                </div>
            </div></a>
        </c:forEach>

        <div class="col-12">
            <nav class="text-center mt-4" >
                <div id="page" class="page_div" style="height: 80px; padding-top: 20px; text-align: right;">
                </div>
            </nav>
        </div>

    </div>
</div>

<!-- blog end -->

<!-- footer area start -->
<footer class="footer-area pd-top-140">
    <div class="container">
        <div class="footer-bottom">
            <div class="row">
                <div class="col-md-6">
                    <div class="thumb">
                        <img src="assets/img/logo.png" alt="img">
                    </div>
                </div>
                <div class="col-md-6 text-md-right mt-3 mt-md-0 align-self-center">
                    <p>Copyright &copy; 2020.Company name All rights reserved.</p>
                </div>
            </div>
        </div>
    </div>
</footer>
<!-- footer area end -->

<!-- back to top area start -->
<div class="back-to-top">
    <span class="back-top"><i class="fa fa-angle-up"></i></span>
</div>
<!-- back to top area end -->
<!-- all plugins here -->
<script src="assets/js/vendor.js"></script>
<!-- main js  -->
<script src="assets/js/main.js"></script>
</body>


<script src="${pageContext.servletContext.contextPath}/js/page/paging.js"></script>
<script>
    $(function () {
        //分页
        $("#page").paging({
            pageNo:${noticeList.currentPage}, /**当前页*/
            totalPage:${noticeList.totalPage}, /**每页显示的记录数*/
            totalSize: ${noticeList.totalCount}, /**共多少条数据*/
            callback: function (num) {
                /**num为当前点击的页面*/
                window.location.href = "${pageContext.servletContext.contextPath}/NoticeListServlet?currentPage=" + num + "&type=${type}&pageSize=3"
            }
        });
    });
</script>
</html>